From: Keir Fraser Date: Tue, 31 Mar 2009 10:36:11 +0000 (+0100) Subject: minios: _chk_fail and _chk canaries for minios and newlib X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13989^2~56 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=1ecaba192cef7fbdfb28504275d9396af7e4da36;p=xen.git minios: _chk_fail and _chk canaries for minios and newlib Add __stack_chk_fail to mini-os and __sprintf_chk __fprintf_chk to newlib, to cope with ocaml runtimes compiled with -fstack-protector. From: "George S. Coker, II" Signed-off-by: Samuel Thibault --- diff --git a/extras/mini-os/lib/stack_chk_fail.c b/extras/mini-os/lib/stack_chk_fail.c new file mode 100644 index 0000000000..ade0045f0a --- /dev/null +++ b/extras/mini-os/lib/stack_chk_fail.c @@ -0,0 +1,8 @@ +#include +#include + +void __stack_chk_fail(void) +{ + printk("stack smashing detected\n"); + do_exit(); +} diff --git a/stubdom/Makefile b/stubdom/Makefile index dcb614fc85..fabb6908de 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -91,6 +91,7 @@ newlib-$(NEWLIB_VERSION).tar.gz: newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz tar xzf $< patch -d $@ -p0 < newlib.patch + patch -d $@ -p0 < newlib-chk.patch touch $@ NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libc.a